﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace LynxBlogAPI.Models.Mapping
{
    public class CommentPolicyMap : EntityTypeConfiguration<CommentPolicy>
    {
        public CommentPolicyMap()
        {
            this.HasKey(t => t.blogid);

            this.Property(t => t.blogid).HasColumnName("BlogId").HasMaxLength(50).IsRequired();
            this.Property(t => t.pagecommentsallowed).HasColumnName("PageCommentsAllowed").IsRequired();
            this.Property(t => t.blogcommentsallowed).HasColumnName("BlogCommentsAllowed").IsRequired();
            this.Property(t => t.ismoderated).HasColumnName("IsModerated").IsRequired();
            this.Property(t => t.requirescaptcha).HasColumnName("RequiresCaptcha").IsRequired();
            this.Property(t => t.showuserlink).HasColumnName("ShowUserlink").IsRequired();
            this.ToTable("tblCommentPolicy");
        }
    }
}